package org.me.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.KeyboardListener;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TabPanel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Widget;

public class Tests02 implements EntryPoint, ClickListener, KeyboardListener {

	static int N = 5;

	static int MAX_N = 100;

	static TextBox[][] matriz_TextBoxes = generaTextBoxes(N, N, "1cm");

	final TabPanel tabPanel = new TabPanel();

	final DockPanel tabpanel_tab2 = new DockPanel();

	public void onModuleLoad() {
		// Tab 1
		final DockPanel tabpanel_tab1 = new DockPanel();
		final HorizontalPanel tabpanel_tab1_HP = new HorizontalPanel();
		(new Button("", this)).addClickListener(this);
		tabpanel_tab1.add(tabpanel_tab1_HP, DockPanel.NORTH);

		tabPanel.setStyleName("myStyles");
		tabPanel.selectTab(1);
		tabPanel.setHeight("100%");
		tabPanel.setWidth("100%");
		RootPanel.get("slot3").add(tabPanel);
	}

	public void onClick(Widget sender) {
		// TODO Auto-generated method stub

	}

	public void onKeyDown(Widget sender, char keyCode, int modifiers) {
		// TODO Auto-generated method stub

	}

	public void onKeyPress(Widget sender, char keyCode, int modifiers) {
		// TODO Auto-generated method stub

	}

	public void onKeyUp(Widget sender, char keyCode, int modifiers) {
		// TODO Auto-generated method stub

	}

	public static TextBox[][] generaTextBoxes(int Nx, int Ny, String Length) {
		TextBox[][] matriz_TextBoxes = new TextBox[Nx][Ny];
		for (int i = 0; i < matriz_TextBoxes.length; i++) {
			for (int j = 0; j < matriz_TextBoxes[i].length; j++) {
				matriz_TextBoxes[i][j] = new TextBox();
				matriz_TextBoxes[i][j].setWidth(Length);
			}
		}
		return matriz_TextBoxes;
	}

}
